package StudyCode.summary.myfile;

import java.io.File;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class DisplayingDirectoriesTree {
	public static void main(String[] args) {
		File dir = new File("E:\\CODE\\JAVA\\ReviewCode\\src\\StudyCode\\");
		System.out.println("根路径:" + dir.getPath());
		System.out.println(dir.getName());
		listDirectories(dir, "  ");
	}

	private static void listDirectories(File dir, String indent) {
		File[] dirs = dir.listFiles();
		for (File f : dirs) {
			if (f.isDirectory()) {
				System.out.println(indent + f.getName());
				listDirectories(f, indent + "  ");
			}
		}
	}

}
